Cosmic crystallization